-
Notifications
You must be signed in to change notification settings - Fork 234
fix: implement lazy evaluation in Coalesce function #2270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: implement lazy evaluation in Coalesce function #2270
Conversation
@andygrove , Please kick off the CI whenever you get a chance |
cd2c3cb
to
f0055e3
Compare
Rebased with main branch . |
f0055e3
to
e0cdb86
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2270 +/- ##
============================================
+ Coverage 56.12% 57.91% +1.78%
- Complexity 976 1290 +314
============================================
Files 119 146 +27
Lines 11743 13367 +1624
Branches 2251 2373 +122
============================================
+ Hits 6591 7741 +1150
- Misses 4012 4369 +357
- Partials 1140 1257 +117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@andygrove please take a look whenever you get a chance . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @coderfender. This is looking good. I will review tomorrow.
Thank you very much @andygrove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @coderfender
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
Outdated
Show resolved
Hide resolved
10f6557
to
206432a
Compare
Thank you for merging the PR @andygrove . I will rebase ANSI arithmetic changes PR with main branch and update there |
Which issue does this PR close?
Closes #2233
Rationale for this change
Spark performs lazy evaluation with the coalesce function while comet/ data fusion does not . This causes different behavior when one of the expressions errors out (ex: division by zero) .
What changes are included in this PR?
This change essentially converts spark's coalesce nodes into case statement node (to leverage current comet functionality) . This change is minimal and easy to revert once the upstream datafusion bug is fixed.
How are these changes tested?
Unit tests to ensure lazy evaluation is performed